<%--
  Created by IntelliJ IDEA.
  User: Albert Lee
  Date: 2020/5/12
  Time: 18:06
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>get Cookie</title>
</head>
<body>
        <%
            //3.获取COOKIE
            Cookie[] cookies = request.getCookies();
            for(Cookie ck:cookies){
                if(ck.getName().equals("name")){
                    out.write("<h2>访问记录:");
                    out.write(java.net.URLDecoder.decode(ck.getValue()) );
                    out.write("</h2><br>");
                    // 机型name:苹果-小米-华为-苹果
                }
            }

        %>
</body>
</html>
